package A3GCPackage;

import java.io.Serializable;
import java.util.Date;

import org.jgroups.Address;

public class SingleNodeData 
	implements Comparable<SingleNodeData>, Serializable
{
	private static final long serialVersionUID = 1423692211009724729L;
	public String name;
	public boolean active;
	public int decay;
	public String group;
	public Date timestamp;
	public Address address;
	
	public SingleNodeData()
	{
		name = "";
		active = false;
		decay = 0;
		group = "";
		timestamp = new Date( System.currentTimeMillis() );
		address = null;
	}
	
	@Override
	public int compareTo(SingleNodeData o) 
	{
		// use timestamp as the comparing piece
		return timestamp.compareTo( o.timestamp );
	}
	
	public void updateData()
	{
		timestamp = new Date( System.currentTimeMillis() );
	}
}
